import React from "react";

const Index: React.FC<{ children: JSX.Element; roles: string[] }> = ({
  children,
  roles,
}) => {
  const role = localStorage.getItem("role") || "";

  if (roles.includes(role)) {
    return children;
  }

  return null;
};

export default Index;
